package javaDemo;

import java.util.function.Function;

public class FunctionDemo {

    public static void main(String[] args) {
        String s = "林青霞,30";
        int res = test(s,
                str -> str.split(",")[1],
                str1 -> Integer.parseInt(str1),
                (Integer i) -> i + 70);
        System.out.println(res);

    }

    public static int test(String s, Function<String, String> f1, Function<String, Integer> f2, Function<Integer, Integer> f3) {
        int i = f1.andThen(f2).andThen(f3).apply(s);
        return i;
    }
}
